import { trigger, state, animate, style, transition } from '@angular/animations';

export const routerTransition = trigger('routeAnimation', [
    state('*',
        style({
            opacity: 1,
            height: '100%',
            width: '100%',
            transform: 'translateX(0)'
        })
    ),
    transition(':enter', [
        style({
            opacity: 1,
            transform: 'translateX(100%)'
        }),
        animate('0.2s cubic-bezier(0.19, 1, 0.22, 1)')
    ]),
    transition(':leave', [
        animate('0.2s cubic-bezier(0.19, 1, 0.22, 1)', style({
            opacity: 0,
            transform: 'translateX(100%)'
        }))
    ])
])